<?php

/**
 * Created by PhpStorm.
 * User: zhangrongxiang
 * Date: 2017/6/11
 * Time: 下午1:32
 */
class ZingClass
{
    public $name = ZingClass::class;
    public function test()
    {
        echo get_called_class() . PHP_EOL;
    }

    public static function staticTest()
    {
        echo get_called_class() . PHP_EOL;
    }
    public function getDeclared()
    {
        var_dump(get_declared_classes());
    }
}

$zing = new ZingClass();

echo class_exists(get_class($zing)) . PHP_EOL;
echo class_exists('ZingClass') . PHP_EOL;

class_alias('ZingClass', 'TestClass');
$test = new TestClass();
echo get_class($test) . PHP_EOL;

$zing->test();
ZingClass::staticTest();

var_dump(get_class_methods('ZingClass'));
var_dump(get_class_vars('ZingClass'));


//$zing->getDeclared();
foreach (get_declared_classes() as $k){
    echo $k.PHP_EOL;
}

var_dump(get_declared_traits());

var_dump(get_object_vars($zing));

echo is_a($zing,"ZingClass");

echo method_exists($zing,'test');